package tuSecure;

import com.google.appengine.api.datastore.Key;
import com.google.appengine.api.users.User;

import java.util.Date;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

@PersistenceCapable
public class Message 
{
	@PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Key key;
	
	@Persistent
	String Name;
	
	@Persistent
	private double lat;
	
	@Persistent
	private double longt;
	
	@Persistent
	private int type;

	public Message(String name, double latt,double longt, int type)
	{
		this.Name=name;
		this.lat =latt;
		this.longt=longt;
		this.type=type;
	}
	
	 public Key getKey() 
	 {
		 return key;
	 }
	
	public String getName()
	{
		return Name;
	}
	
	public double getLattitude()
	{
		return lat;
	}
	
	public double getLongitude()
	{
		return longt;
	}
	
	public String getEmergency()
	{
		String val;
		
		switch (type)
		{
		case 0:	val="Medical Emergency";break;
		case 1: val="Crime Emergency";break;
		case 2: val="Fire Emergency";break;
		case 3: val="Social";break;
		default:val ="No Type Specified type:"+type;break;
		}
		
		return val;
	}
	
	public int getType()
	{
		return this.type;
	}
	
	public void setName(String name)
	{
		this.Name= name;
	}
	
	public void setLattitude(double lat)
	{
		this.lat=lat;
	}
	
	public void setLongtitude(double longt)
	{
		this.longt=longt;
	}
	
	public void setEmergency(int type)
	{
		this.type=type;
	}
	
}
